<?php

/*
 * 操作员修改
 */

namespace Admin\Func;

class Func901010102 {

    var $rst;
    var $errmsg;
    var $OperatorID;
    var $OperatorName;

    public function __construct($OperatorID, $OperatorName) {
        $this->errmsg = '';
        $this->OperatorID = addslashes($OperatorID);
        $this->OperatorName = addslashes($OperatorName);
    }

    /*
     * 获取错误信息
     */

    public function getErrMsg() {
        return $this->errmsg;
    }

    /*
     * 验证
     */

    private function validate() {
        return true;
    }

    /*
     * 执行
     */

    public function execute() {
        $vflag = true;
        $OperID = I('OperID');
        if ($this->validate()) {

            $sql = <<<EOD
update t_lz_sys_operator t set t.OperatorName='$this->OperatorName'
where t.OperatorID='$this->OperatorID'
EOD;

            $model = new \Think\Model();
            //$this->rst = $model->query($sql);
            $this->rst = $model->execute($sql);

            if ($this->rst === false) {
                $this->errmsg = $model->getDbError();
                $vflag = false;
            } else {
                $vflag = true;
            }
        } else {
            $vflag = false;
        }
        return $vflag;
    }

    public function getRst() {
        return $this->rst;
    }

}
